package com.ipet.app.api;


import com.ipet.app.bean.apiRequestBean.AgreePostRequest;
import com.ipet.app.bean.apiRequestBean.AnimalImageByIdRequest;
import com.ipet.app.bean.apiRequestBean.AnimalTypeRequest;
import com.ipet.app.bean.apiRequestBean.AnimalsSearchByIdRequest;
import com.ipet.app.bean.apiRequestBean.AnimalsSearchRequest;
import com.ipet.app.bean.apiRequestBean.CancelAgreePostRequest;
import com.ipet.app.bean.apiRequestBean.CreateTopicRequest;
import com.ipet.app.bean.apiRequestBean.DelReplyRequest;
import com.ipet.app.bean.apiRequestBean.LoginRequest;
import com.ipet.app.bean.apiRequestBean.PageRequest;
import com.ipet.app.bean.apiRequestBean.PostDetailRequest;
import com.ipet.app.bean.apiRequestBean.ProvincesSearchRequest;
import com.ipet.app.bean.apiRequestBean.ReplyPostRequest;
import com.ipet.app.bean.apiRequestBean.SearchTopicRequest;
import com.ipet.app.bean.apiResponseBean.AnimalImageByIdResponse;
import com.ipet.app.bean.apiResponseBean.AnimalTypeResponse;
import com.ipet.app.bean.apiResponseBean.AnimalsSearchByIdResponse;
import com.ipet.app.bean.apiResponseBean.AnimalsSearchResponse;
import com.ipet.app.bean.apiResponseBean.BaseResponse;
import com.ipet.app.bean.apiResponseBean.CreateTopicResponse;
import com.ipet.app.bean.apiResponseBean.HotResponse;
import com.ipet.app.bean.apiResponseBean.LoginResponse;
import com.ipet.app.bean.apiResponseBean.MyPostResponse;
import com.ipet.app.bean.apiResponseBean.PostDetailResponse;
import com.ipet.app.bean.apiResponseBean.ProvincesSearchResponse;
import com.ipet.app.bean.apiResponseBean.RegisterResponse;
import com.ipet.app.bean.apiResponseBean.SearchTopicResponse;
import com.ipet.app.bean.apiResponseBean.WatchFriendResponse;

import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;

//对应postMan地址(民政版) https://www.getpostman.com/collections/8cd88c086fc87be9f60b
//对应postMan地址(刘经济版） https://www.getpostman.com/collections/787f8578e114f2cc18b3
public interface Api {

    String API_URL = "http://120.27.113.233";
    String URL_PRE = "/index.php?s=/";

    /**
     * 2 注册 表单提交 键值对
     */
    @FormUrlEncoded
    @POST(URL_PRE + "Login/register")
    Call<RegisterResponse> registr(@Field("phone_num") String phoneNum, @Field("password") String passWord);

    /**
     * 3 登陆
     */
    @POST(URL_PRE + "Login/login")
    Call<LoginResponse> login(@Body LoginRequest loginRequest);

    /**
     * 4 发帖
     */
    @Multipart
    @POST(URL_PRE + "Content/original")
    Call<BaseResponse> writePost(@Part("theme") RequestBody title, @Part("content") RequestBody content,
                                 @Part("topic") RequestBody topic, @Part("image[]\"; filename=\"image.png\" ") RequestBody... image);

    /**
     * 5 获取自己发布的内容
     */
    @POST(URL_PRE + "Content/ownContentList")
    Call<MyPostResponse> getMyPost(@Body PageRequest pageRequest);

    /**
     * 6 关注好友
     */
    @POST(URL_PRE + "Friend/interest")
    Call<BaseResponse> watchFriend();


    /**
     * 7 获取关注的好友
     */
    @POST(URL_PRE + "Friend/friendlist")
    Call<WatchFriendResponse> getWatchedFriends();

    /**
     * 8 获取内容列表
     */
    @POST(URL_PRE + "Content/contentlist")
    Call<HotResponse> getHotPost(@Body PageRequest pageRequest);

    /**
     * 9 评论帖子
     */
    @POST(URL_PRE + "Reply/comment")
    Call<BaseResponse> replyPost(@Body ReplyPostRequest replyPostRequest);

    /**
     * 10 点赞
     */
    @POST(URL_PRE + "Content/agree")
    Call<BaseResponse> agreePost(@Body AgreePostRequest agreePostRequest);

    /**
     * 11 取消点赞
     */
    @POST(URL_PRE + "Content/disagree")
    Call<BaseResponse> cancelAgreePost(@Body CancelAgreePostRequest cancelAgreePostRequest);

    /**
     * 12 创建话题
     */
    @POST(URL_PRE + "Topic/createtopic")
    Call<CreateTopicResponse> createTopic(@Body CreateTopicRequest loginRequest);

    /**
     * 13 获取帖子详情
     */
    @POST(URL_PRE + "Content/index")
    Call<PostDetailResponse> getPostDetail(@Body PostDetailRequest postDetailRequest);

    /**
     * 14 删除评论
     */
    @POST(URL_PRE + "Reply/delreply")
    Call<BaseResponse> delReplyPost(@Body DelReplyRequest delReplyRequest);

    /**
     * 15 搜说话题
     */
    @POST(URL_PRE + "Topic/topiclist")
    Call<SearchTopicResponse> searchTopic(@Body SearchTopicRequest loginRequest);

    /**
     * 16 登出
     */
    @POST(URL_PRE + "Login/logout")
    Call<BaseResponse> logOut();

    /**
     * 17 获取服务商家列表
     */
    @POST(URL_PRE + "Services/index")
    Call<String> getServices();

    /**
     * 18 更新服务商家
     */
    @POST(URL_PRE + "Services/operate")
    Call<String> updateServices();

    /**
     * 19 获取商家评论
     */
    @POST(URL_PRE + "Services/commentList")
    Call<String> getServicesReply();

    /**
     * 20 给商家评论
     */
    @POST(URL_PRE + "Services/comment")
    Call<String> replyServices();

    /**
     * 21 获取动物类型
     */
    @POST(URL_PRE + "Animal/getType")
    Call<AnimalTypeResponse> getAnimalType(@Body AnimalTypeRequest animalTypeRequest);

    /**
     * 22 动物搜索接口
     */
    @POST(URL_PRE + "Animal/getAnimalByType")
    Call<AnimalsSearchResponse> serarchAnimalsByType(@Body AnimalsSearchRequest animalsSearchRequest);

    /**
     * 23 更具宠物id获取宠物图片
     */
    @POST(URL_PRE + "Animal/getAnimalPic")
    Call<AnimalImageByIdResponse> getImageByAnimalId(@Body AnimalImageByIdRequest animalImageByIdrequest);

    /**
     * 24动物搜索接口
     */
    @POST(URL_PRE + "Animal/getAnimalById")
    Call<AnimalsSearchByIdResponse> serarchAnimalById(@Body AnimalsSearchByIdRequest animalsSearchByIdRequest);

    /**
     * 25 搜索市区
     */
    @POST(URL_PRE + "Util/getProvinces")
    Call<ProvincesSearchResponse> searchProvinces(@Body ProvincesSearchRequest provincesSearchRequest);


}
